 
function fillTable(user) {
 
  dwr.util.setValue('results', user,{ escapeHtml:false });
     $( "#accordion1" ).accordion();
 
}
 
 

function filterChanged() {
  var filter = dwr.util.getValue("filter");
  
  if (filter.length == 0) {
  dwr.util.setValue('results','');
  }else{
      dwrService.findUsersOrg(filter,  
{
         callback: fillTable,
         preHook:function() {
            $("#loading").show();
         },
         postHook:function() {
            $("#loading").hide();
              
         }
      });  
}
    
 
}
//function filterChanged() {
//  var filter = dwr.util.getValue("filter");
//  
//  if (filter.length == 0) {
//  dwr.util.setValue('results','');
//  }else{  dwrService.findUsersOrg(filter,fillTable);  }
//    
// 
//}
  
 $(document).ready(function() {
 
 $("#filter").keypress(function(event) {
     
  if ( event.which == 13 ) {
      filterChanged()
     event.preventDefault();
   }
  
     });
}); 